// Copyright 2007 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.enterprise.connector.afyd;

import com.google.enterprise.connector.spi.RepositoryException;
import com.google.gdata.data.Entry;

import java.util.List;

/**
 * This interface should be implemented by classes wishing to provide
 * traverse-able back ends to the Afyd connector.
 * 
 * @author amsmith@google.com (Adam Smith)
 */
public interface FeedEntryProvider {
  
  /**
   * Gets a list of entries for a given user. 
   * 
   * @param username is the specific user for whom entries should be returned
   * @param checkpoint is the last result of getCheckpointForEntry() or it is
   *    null (indicating all documents should be returned
   * @return a List of Entry objects, ordered to be checkpoint compatible
   */
  public List getOrderedEntriesForUser(String username, String checkpoint)
    throws RepositoryException;
  
  /**
   * Gets a checkpoint string for the given Entry that was returned in the list
   * from getOrderedEntriesForUser() that can be passed back to that method.
   * 
   * @param entry is the in question
   * @return some String representing the space in the traversal order that
   *    comes after this Entry
   */
  public String getCheckpointForEntry(Entry entry) throws RepositoryException;
}
